<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" name="age" />
    <span id="msg"></span>
  </body>
  <script>
    //比较运算符== === >= <= > <

    let span = document.querySelector("#msg");
    document.querySelector('[name="age"]').addEventListener("keyup", (elem) => {   
      span.innerHTML = elem.target.value >= 90 ? "年龄不能大于90" : "";
    });
  </script>
</html>
